package com.linkhub.oms.admin.common.util.EnumValueConstraintUtil;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
/**
 * @ClassName EnumValueConstraint
 * @Description: com.linkhub.oms.admin.common.util.EnumValueConstraintUtil
 * @Author: Jaycle
 * @CreateDate: 2024/11/23 21:29
 * @Version: 1.0
 */

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Constraint(validatedBy = EnumValueConstraintValidator.class)
public @interface EnumValueConstraint {
    String message() default "Invalid value";

    Class<?>[] groups() default {};

    Class<? extends Enum<?>> enumClass(); // 枚举类

    String field(); // 枚举类字段名，用于对比

    String[] excludedValues() default {}; // 可选参数，默认不排除任何值

    Class<? extends Payload>[] payload() default {};
}
